package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: dishFlavorMapper
 * Package: com.sky.mapper
 * Description:
 *
 * @Author 谢依雯
 * @Create 2024/11/19 23:20
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 批量插入口味数据
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据菜品id删除关联的口味信息
     * @param ids
     */
    void delete(List<Long> ids);

    /**
     * 根据菜品id查询
     * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> getByDishId(Long id);
}
